import request from "@/utils/request";
import qs from "qs";

// 查询扫描结果统计信息列表
export function queryStatisticsListByPage(query) {
  return request({
    url: "/datascan/b/scanresultstatistics/queryPageList",
    method: "get",
    params: query,
  });
}

export function queryExecutionPolicyPageList(query) {
  return request({
    url: "/datascan/b/scanresultstatistics/queryExecutionPolicyPageList",
    method: "get",
    params: query,
  });
}

export function queryDBTaskHistoryCount(data) {
  return request({
    url: "/datascan/b/homecount/queryDBTaskHistoryCount",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
    data: qs.stringify(data),
  });
}

export function queryDBTaskHistoryCount1(data) {
  return request({
    url: "/datascan/b/homecount/queryDBTaskHistoryCount1",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
    data: qs.stringify(data),
  });
}

// 查询扫描结果统计信息详细
export function getStatistics(dbId) {
  return request({
    url: "/datascan/statistics/" + dbId,
    method: "get",
  });
}

// 新增扫描结果统计信息
export function addStatistics(data) {
  return request({
    url: "/datascan/statistics",
    method: "post",
    data: data,
  });
}

// 编辑扫描结果统计信息
export function updateStatistics(data) {
  return request({
    url: "/datascan/statistics",
    method: "put",
    data: data,
  });
}

// 删除扫描结果统计信息
export function delStatistics(dbId) {
  return request({
    url: "/datascan/statistics/" + dbId,
    method: "delete",
  });
}

// 删除扫描结果统计信息
export function updatePass(data) {
  return request({
    url: "/datascan/b/scanresultstatistics/updatePass",
    method: "post",
    data: data,
  });
}
